package com.wdh.kjs.fragment;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ScrollView;

import com.wdh.kjs.Adapter.InvestmentListAdapter;
import com.wdh.kjs.Adapter.ListViewForScrollView;
import com.wdh.kjs.R;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Created by codingWw on 2016/3/7.
 */
public class Im_raisestop_Fragment extends Fragment {
    private ListViewForScrollView investment_listview;
    private ScrollView investment_scrollview;
    private InvestmentListAdapter investmentListAdapter;
    private List<HashMap<String, String>> datas;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_raisestop, container, false);
//        initView(view);
//        initwidge();
        return view;
    }
    private void initView(View view) {
        investment_listview = (ListViewForScrollView) view.findViewById(R.id.fragment_investment_listview);
        investment_scrollview = (ScrollView) view.findViewById(R.id.fragment_investment_scrollview);
        investment_scrollview.smoothScrollTo(0, 0);

    }
    private void initwidge() {
        investmentListAdapter=new InvestmentListAdapter(getActivity(),initListViewData());
        investment_listview.setAdapter(investmentListAdapter);
    }
    private List<HashMap<String, String>> initListViewData() {
        datas = new ArrayList<>();
        for(int i=0;i<2;i++){
            HashMap<String, String> hashMap = new HashMap<>();
            hashMap.put("tv_investment_type", "三农贷");
            hashMap.put("tv_investment_name", "测试1号");
            hashMap.put("tv_investment_available_amount", "￥500,000.00元");
            hashMap.put("item_investment_scale", "10%");
            hashMap.put("item_investment_month", "90天");
            hashMap.put("item_investment_financing_amount", "￥1,00000元");
            hashMap.put("item_investment_progress", "50%");
            datas.add(hashMap);
        }
        for(int i=0;i<2;i++){
            HashMap<String, String> hashMap = new HashMap<>();
            hashMap.put("tv_investment_type", "政信贷");
            hashMap.put("tv_investment_name", "测试1号");
            hashMap.put("tv_investment_available_amount", "￥500,000.00元");
            hashMap.put("item_investment_scale", "10%");
            hashMap.put("item_investment_month", "90天");
            hashMap.put("item_investment_financing_amount", "￥1,00000元");
            hashMap.put("item_investment_progress", "一天后开抢");
            datas.add(hashMap);
        }
        for(int i=0;i<2;i++){
            HashMap<String, String> hashMap1 = new HashMap<>();
            hashMap1.put("tv_investment_type", "三农贷");
            hashMap1.put("tv_investment_name", "测试1号");
            hashMap1.put("tv_investment_available_amount", "￥500,000.00元");
            hashMap1.put("item_investment_scale", "10%");
            hashMap1.put("item_investment_month", "90天");
            hashMap1.put("item_investment_financing_amount", "￥1,000,00元");
            hashMap1.put("item_investment_progress", "已满标");
            datas.add(hashMap1);
        }
        return datas;

    }
}
